﻿<UserControl x:Class="WellDone.LayoutViewer"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:LayoutManager="clr-namespace:FloorDesigner;assembly=FloorDesigner" 
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:local="clr-namespace:WellDone" d:DesignHeight="449" d:DesignWidth="637.015" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    Background="Red" Width="1141" Loaded="UserControl_Loaded" Unloaded="UserControl_Unloaded">

    <UserControl.Resources>
        <Style x:Key="MyWhiteText" TargetType="sdk:Label">
            <Setter Property="Foreground" Value="{StaticResource WhiteBrush}"/>
        </Style>
        <Style x:Key="RectangleStyle" TargetType="LayoutManager:TableControl">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="LayoutManager:TableControl">
                        <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="rectangle" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" 
                                                                      Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Storyboard.TargetName="rectangle" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames 
                                                BeginTime="00:00:00" 
                                                Storyboard.TargetName="rectangle" 
                                                Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames 
                                                BeginTime="00:00:00" 
                                                Storyboard.TargetName="rectangle" 
                                                Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="rectangle" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="DraggingStates">
                                    <vsm:VisualState x:Name="DragStarted">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="LayoutRoot" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.495"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Dropped">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="LayoutRoot" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="SurfaceStates">
                                    <vsm:VisualState x:Name="SurfaceEnter">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="rectangle" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="SurfaceLeave">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="rectangle" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Rectangle Margin="0,0,0,0" Stroke="#FF000000" x:Name="rectangle" Opacity="0">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF000000"/>
                                        <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Border>
                                <Image x:Name="imgdrag" Cursor="Hand" Source="/WellDone;component/Images/icon_drag_drop.png" Width="19" Height="19" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Visible"  ToolTipService.ToolTip="Drag and drop table"/>
                            </Border>
                            <Border>
                                <TextBlock x:Name="tableID"  Text="0" HorizontalAlignment="Center" VerticalAlignment="Center"  Foreground="White"></TextBlock>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="EllipseStyle" TargetType="LayoutManager:TableControl">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="LayoutManager:TableControl">
                        <Grid x:Name="EllipseLayoutRoot" Background="{TemplateBinding Background}">
                            <vsm:VisualStateManager.VisualStateGroups>
                                <vsm:VisualStateGroup x:Name="CommonStates">
                                    <vsm:VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="Ellipse" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" 
                                                                      Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Storyboard.TargetName="Ellipse" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames 
                                                BeginTime="00:00:00" 
                                                Storyboard.TargetName="Ellipse" 
                                                Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames 
                                                BeginTime="00:00:00" 
                                                Storyboard.TargetName="Ellipse" 
                                                Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="Ellipse" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="DraggingStates">
                                    <vsm:VisualState x:Name="DragStarted">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="EllipseLayoutRoot" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.495"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="Dropped">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="EllipseLayoutRoot" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                                <vsm:VisualStateGroup x:Name="SurfaceStates">
                                    <vsm:VisualState x:Name="SurfaceEnter">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="Ellipse" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                    <vsm:VisualState x:Name="SurfaceLeave">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" 
                                                                           Duration="00:00:00.0010000" 
                                                                           Storyboard.TargetName="Ellipse" 
                                                                           Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </vsm:VisualState>
                                </vsm:VisualStateGroup>
                            </vsm:VisualStateManager.VisualStateGroups>
                            <Ellipse Margin="0,0,0,0" Stroke="#FF000000" x:Name="Ellipse" Opacity="0">
                                <Ellipse.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF000000"/>
                                        <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Ellipse.Fill>
                            </Ellipse>
                            <Border>
                                <Image x:Name="imgdrag" Cursor="Hand" Source="/WellDone;component/Images/icon_drag_drop.png" Width="19" Height="19" VerticalAlignment="Center" HorizontalAlignment="Center" Visibility="Visible"  ToolTipService.ToolTip="Drag and drop table"/>
                            </Border>
                            <Border>
                                <TextBlock x:Name="tableID"  Text="0" HorizontalAlignment="Center" VerticalAlignment="Center"  Foreground="White"></TextBlock>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="#FFC5C2BF" HorizontalAlignment="Left" Width="1141" >
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid Grid.Row="0" Grid.Column="0" Width="1143" Margin="-2,0,0,6" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.523" >
            <Grid.Background>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Black" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="163"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="11"/>
            </Grid.ColumnDefinitions>

            <sdk:Label  x:Name="lblHeader"  Content="" Grid.Row="0" VerticalAlignment="Center" Margin="22,16,497,15" Height="19" FontWeight="Bold"  Style="{StaticResource MyWhiteText}" >

            </sdk:Label>
            <Rectangle Grid.Row="0" VerticalAlignment="Center" Margin="500,12,330,12" Height="21" Width="20"  Fill="Blue" ToolTipService.ToolTip="Available"></Rectangle>
            <sdk:Label Content="Available" Grid.Row="0" VerticalAlignment="Center" Margin="500,12,275,12" Height="21" HorizontalAlignment="Right"  Style="{StaticResource MyWhiteText}" />

            <Rectangle Grid.Row="0" VerticalAlignment="Center" Margin="600,12,230,12" Height="21" Width="20" Fill="Green" ToolTipService.ToolTip="Reserved" ></Rectangle>
            <sdk:Label Content="Reserved" Grid.Row="0" VerticalAlignment="Center" Margin="500,12,175,12" Height="21" HorizontalAlignment="Right"  Style="{StaticResource MyWhiteText}" />

            <sdk:Label Content="Layout Name " Grid.Row="0" VerticalAlignment="Center" Margin="620,12,10,12" Height="21" HorizontalAlignment="Right"  Style="{StaticResource MyWhiteText}" />

            <ComboBox x:Name="ddlLayout" Width="280"  Height="25" Grid.Row="0"  IsEnabled="False" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,13,0,12" SelectionChanged="ddlLayout_SelectionChanged" SelectedValuePath="Tag"  HorizontalContentAlignment="Left" Grid.Column="1" Grid.ColumnSpan="4"/>
        </Grid>
        <ScrollViewer Grid.Row="1" Grid.Column="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="1,1,0,0" HorizontalAlignment="Left" Width="Auto" >
            <Canvas x:Name="LayoutContainer"  Width="761" Height="541" HorizontalAlignment="Left"  Grid.Column="0" Grid.Row="1"  VerticalAlignment="Top" />
        </ScrollViewer>
    </Grid>
</UserControl>
    
    